HttpStatus: add RFC 6585 status codes
authorFaidon Liambotis <faidon@wikimedia.org>
Fri, 28 Mar 2014 10:23:16 +0000 (12:23 +0200)
committerFaidon Liambotis <faidon@wikimedia.org>
Fri, 28 Mar 2014 10:25:14 +0000 (12:25 +0200)
Add newer (Apr 2012) HTTP status codes & their messages to HttpStatus'
getMessage. Adds 428, 429, 431, 511 per RFC 6585, "Additional HTTP
Status Codes".

Change-Id: Ia055880c4b2f3ac43cf5d94dbdd45a3690a58569

includes/libs/HttpStatus.php

index 4f626b2..d72ffca 100644 (file)
@@ -75,13 +75,17 @@ class HttpStatus {
                        422 => 'Unprocessable Entity',
                        423 => 'Locked',
                        424 => 'Failed Dependency',
+                       428 => 'Precondition Required',
+                       429 => 'Too Many Requests',
+                       431 => 'Request Header Fields Too Large',
                        500 => 'Internal Server Error',
                        501 => 'Not Implemented',
                        502 => 'Bad Gateway',
                        503 => 'Service Unavailable',
                        504 => 'Gateway Timeout',
                        505 => 'HTTP Version Not Supported',
-                       507 => 'Insufficient Storage'
+                       507 => 'Insufficient Storage',
+                       511 => 'Network Authentication Required',
                );
                return isset( $statusMessage[$code] ) ? $statusMessage[$code] : null;
        }